<p>
Round: <select id="round_select" name="round">
  <option value="">All</option>
  <%= options_for_select @rounds, @current_round %>
</select>
<% game_url = url_for(:action => :games, :id => @championship, :phase => @current_phase, :round => "") %>
<%= observe_field 'round_select', :function => "document.location = '#{game_url}' + value" %>
</p>
<p>
<% if @games_pages.page_count > 1 %>
  <%= pagination_links_remote @games_pages, :url => { :round => @current_round }, :update => "table" %>
<% end %>
</p>
<div>
<% last_played = nil
   last_round = nil
   last_date = nil %>
<% @games.each do |@game| %>
  <% if last_played != @game.played %>
    <% last_played = @game.played %>
    <div class='game_toplay'><%= @game.played_str %></div>
  <% end %>
  <% if last_round != @game.round %>
    <% last_round = @game.round %>
    <div class='game_round'>Round <%= @game.round %></div>
    <% last_date = @game.formatted_date %>
    <div class='game_date'><%= @game.formatted_date(true) %></div>
  <% end %>
  <% if last_date != @game.formatted_date %>
    <% last_date = @game.formatted_date %>
    <div class='game_date'><%= @game.formatted_date(true) %></div>
  <% end %>
    <div class='table_row'>
      <%= render :partial => "game_list" %>
      <div class='clearer'></div>
    </div>
<% end %>
</div>
